package jsu.hx.lost.Mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import jsu.hx.lost.Model.dto.FindItemDTO;
import jsu.hx.lost.Model.dto.UserExportDTO;
import jsu.hx.lost.Model.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    // 查询分页数据
    List<User> selectUserList(
            @Param("offset") int offset,
            @Param("pageSize") int pageSize,
//            @Param("username") String username
            @Param("ew") QueryWrapper<User> queryWrapper
    );

    @Select("SELECT * FROM user_profiles ${ew.customSqlSegment}")
    List<User> selectByCondition(@Param(Constants.WRAPPER) QueryWrapper<User> queryWrapper);
    //查询总记录数
//    long selectUserCount(@Param("username") String username);
    Long selectUserCount(@Param("ew") QueryWrapper<User> queryWrapper);

}
